const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.BIGINT,
      allowNull: false,
      defaultValue: null,
      comment: "主键",
      primaryKey: true,
      field: "id",
      autoIncrement: false
    },
    notice_id: {
      type: DataTypes.BIGINT,
      allowNull: false,
      defaultValue: null,
      comment: "公共通知id",
      primaryKey: false,
      field: "notice_id",
      autoIncrement: false
    },
    user_id: {
      type: DataTypes.BIGINT,
      allowNull: false,
      defaultValue: null,
      comment: "用户id",
      primaryKey: false,
      field: "user_id",
      autoIncrement: false
    },
    is_read: {
      type: DataTypes.BIGINT,
      allowNull: false,
      defaultValue: null,
      comment: "读取状态（0未读；1已读）",
      primaryKey: false,
      field: "is_read",
      autoIncrement: false
    },
    read_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: null,
      comment: "阅读时间",
      primaryKey: false,
      field: "read_time",
      autoIncrement: false
    },
    create_time: {
      type: DataTypes.DATE,
      allowNull: false,
      defaultValue: null,
      comment: "创建时间",
      primaryKey: false,
      field: "create_time",
      autoIncrement: false
    },
    update_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: null,
      comment: "更新时间",
      primaryKey: false,
      field: "update_time",
      autoIncrement: false
    },
    is_deleted: {
      type: DataTypes.INTEGER,
      allowNull: false,
      defaultValue: null,
      comment: "逻辑删除(1-已删除；0-未删除)",
      primaryKey: false,
      field: "is_deleted",
      autoIncrement: false
    }
  };
  const options = {
    tableName: "sys_user_notice",
    comment: "",
    indexes: []
  };
  const SysUserNoticeModel = sequelize.define("sys_user_notice_model", attributes, options);
  return SysUserNoticeModel;
};